# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-branca
pkgname=('python2-branca' 'python-branca')
_pkgname=branca
pkgver=0.8.1
pkgrel=1
pkgdesc='Spinoff from folium, that would host the non-map-specific features.'
arch=('any')
url='https://pypi.org/project/branca/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('39928672760ce055e9352ca6d2c4045ed66243a7883b6c23976acc9c511e5148e877046651b7a2b23fc9ab25954ce5dc3dedc899bf01a0b02d68f99483057360')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-branca() {
  depends=('python2-jinja' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-branca() {
  depends=('python-jinja' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

